package inabit.expressioncompiler.parser;

import inabit.compiler.parser.grammar.Grammar;
import inabit.expressioncompiler.lexical.ExpressionTokenClass;
import inabit.expressioncompiler.productions.A1_Rule;
import inabit.expressioncompiler.productions.A1_Rule2;
import inabit.expressioncompiler.productions.A_Rule;
import inabit.expressioncompiler.productions.F1_Rule;
import inabit.expressioncompiler.productions.F1_Rule2;
import inabit.expressioncompiler.productions.F1_Rule3;
import inabit.expressioncompiler.productions.F_Rule;
import inabit.expressioncompiler.productions.G_Rule;
import inabit.expressioncompiler.productions.G_Rule2;
import inabit.expressioncompiler.productions.J_Rule;
import inabit.expressioncompiler.productions.J_Rule2;
import inabit.expressioncompiler.productions.N_Rule;
import inabit.expressioncompiler.productions.N_Rule2;
import inabit.expressioncompiler.productions.U_Rule;
import inabit.expressioncompiler.productions.U_Rule2;
import inabit.expressioncompiler.productions.X1_Rule;
import inabit.expressioncompiler.productions.X1_Rule2;
import inabit.expressioncompiler.productions.X1_Rule3;
import inabit.expressioncompiler.productions.X_Rule;
import inabit.expressioncompiler.productions.Z1_Rule;
import inabit.expressioncompiler.productions.Z1_Rule2;
import inabit.expressioncompiler.productions.Z_Rule;
import inabit.expressioncompiler.productions.Z_Rule2;
import inabit.expressioncompiler.productions.Z_Rule3;
import inabit.expressioncompiler.productions.Z_Rule4;
import inabit.expressioncompiler.productions.Z_Rule5;
/**@author Rafael Rocha*/
public class ExpressionGrammar {
	private ExpressionGrammar() {
		
	}
	
	public static Grammar buildGrammar(){
		Grammar myGrammar = new Grammar();
		
		myGrammar.addTerminals(ExpressionTokenClass.values());
		
		myGrammar.addProductionRules(
				new A_Rule(),
				new X1_Rule(), new X1_Rule2(), new X1_Rule3(),
				new X_Rule(),
				new F1_Rule(), new F1_Rule2(), new F1_Rule3(),
				new F_Rule(),
				new Z1_Rule(), new Z1_Rule2(),
				new Z_Rule(), new Z_Rule2(), new Z_Rule3(), new Z_Rule4(), new Z_Rule5(),
				new J_Rule(), new J_Rule2(),
				new U_Rule(), new U_Rule2(),
				new A1_Rule(), new A1_Rule2(),
				new G_Rule(), new G_Rule2(),
				new N_Rule(), new N_Rule2());
		
		myGrammar.setInitialSymbol("A");
		
		myGrammar.setEOF(ExpressionTokenClass.EOF);
		return myGrammar;
	}
}
